package com.kungfuhacking.wristbandpro.location.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Aaron on 17/4/21.
 */

public class OldEntity implements Parcelable {

    private String id;
    private String name;
    private String sex;
    private String picUrl;
    private String birthday;
    private String year;
    private String distance;
    private int level;
    private String sn;
    private boolean isSelect;
    private String phoneNum;
    private String nickName;

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    private DeviceEntity device;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public DeviceEntity getDevice() {
        return device;
    }

    public void setDevice(DeviceEntity device) {
        this.device = device;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.name);
        dest.writeString(this.sex);
        dest.writeString(this.picUrl);
        dest.writeString(this.birthday);
        dest.writeString(this.year);
        dest.writeString(this.distance);
        dest.writeInt(this.level);
        dest.writeString(this.sn);
        dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
        dest.writeString(this.phoneNum);
        dest.writeString(this.nickName);
        dest.writeParcelable(this.device, flags);
    }

    public OldEntity() {
    }

    protected OldEntity(Parcel in) {
        this.id = in.readString();
        this.name = in.readString();
        this.sex = in.readString();
        this.picUrl = in.readString();
        this.birthday = in.readString();
        this.year = in.readString();
        this.distance = in.readString();
        this.level = in.readInt();
        this.sn = in.readString();
        this.isSelect = in.readByte() != 0;
        this.phoneNum = in.readString();
        this.nickName = in.readString();
        this.device = in.readParcelable(DeviceEntity.class.getClassLoader());
    }

    public static final Parcelable.Creator<OldEntity> CREATOR = new Parcelable.Creator<OldEntity>() {
        @Override
        public OldEntity createFromParcel(Parcel source) {
            return new OldEntity(source);
        }

        @Override
        public OldEntity[] newArray(int size) {
            return new OldEntity[size];
        }
    };
}
